import request from "@/utils/request";
const BASE_URL = "wblog_article";

export default {
  searchPage(page, size, searchMap) {
    return request({
      url: `${BASE_URL}/tag/search/${page}/${size}`,
      method: "post",
      data: searchMap
    });
  },
  addTag(pojo) {
    return request({
      url: `${BASE_URL}/tag`,
      method: "post",
      data: pojo
    });
  },
  updateTag(pojo) {
    return request({
      url: `${BASE_URL}/tag/${pojo.id}`,
      method: "put",
      data: pojo
    });
  },
  getTagById(id) {
    return request({
      url: `${BASE_URL}/tag/${id}`,
      method: "get"
    });
  },
  deleteById(id) {
    return request({
      url: `${BASE_URL}/tag/delete/${id}`,
      method: "put"
    });
  },
  /**
   * 查询前三条记录
   */
  findTop3Data(page, size) {
    return request({
      url: `${BASE_URL}/tag/top3/${page}/${size}`,
      method: "post"
    });
  }
};
